package com.zy.design.state;

import com.zy.design.state.common.MStateMachine;
import com.zy.design.state.common.SmallMario;
import com.zy.design.state.table.MarioStateMachine;

/**
 * @author zhaoyi
 * @date 2021/9/23 11:48
 */
public class Test {

    public static void main(String[] args) {

        //查表法的状态机
        /*MarioStateMachine stateMachine = new MarioStateMachine();
        System.out.println("初始化 " + stateMachine);

        stateMachine.eatCape();
        System.out.println("获得斗篷 " + stateMachine);

        stateMachine.monster();
        System.out.println("遇到怪物 " + stateMachine);*/


        //通用的分多个类的方法
        MStateMachine machine = new MStateMachine();
        machine.eatMustRoom();
        System.out.println("吃蘑菇 " + machine);

        machine.eatCape();
        System.out.println("获得斗篷 " + machine);

        machine.eatCape();
        System.out.println("再次获得斗篷 " + machine);

        machine.monster();
        System.out.println("遇到怪物 " + machine);





    }
}
